﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;

namespace Utility.BehaviourTree
{
	[HideFromCreateMenu]
	public class TaskNode : LeafNode
	{
		Func<DataBoard, Status> func;

		public TaskNode (Func<DataBoard, Status> func)
		{
			Debug.Assert (func != null, "func cannot be null");
			this.func = func;
		}

		protected override Status OnUpdate ()
		{
			return func (DataBoard);
		}
	}
}